#ifndef __KINCOMOTOR_LL_H
#define __KINCOMOTOR_LL_H

#include "stm32f4xx.h"
#include <stdbool.h>

#pragma pack(push)
#pragma pack(1)

/**
* @brief 6041 00 10(16bits)
  bit0: Ready_on
  bit1: Switched_on
  bit2: Operation_enable
  bit3: Fault
  bit4: Voltage_enable
  bit5: Quick_stop
  bit6: Switchon_disabled
  bit7: Warning
  bit8: Maunufacture0
  bit9: Remote
  bit10: Target_reached
  bit11: Intlim_active(negative/positive position limit actived)
  bit12: Setpoint_Ack
  bit13: Fllowing_Error
  bit14: Commutation_Found
  bit15: Reference_Found
*/
typedef union{
    struct{
        uint8_t ready_on:1;
        uint8_t switched_on:1;
        uint8_t operaion_enalbe:1;
        uint8_t fault:1;
        uint8_t voltage_enable:1;
        uint8_t quick_stop:1;
        uint8_t switchon_disabled:1;
        uint8_t warning:1;
        uint8_t reserved:1;
        uint8_t remote:1;
        uint8_t target_reached:1;
        uint8_t intlim_active:1;
        uint8_t setpoint_ack:1;
        uint8_t follow_error:1;
        uint8_t comm_found:1;
        uint8_t refrence_found:1;
    }st_;
    uint16_t status;
}KincoStatus_T;

#pragma pack(pop)

extern KincoStatus_T KincoStatus;

#endif
